{% extends 'base.html' %}

{% block content %}
<h1>成绩列表</h1>
<a href="{% url 'add_score' %}">添加成绩表</a>
<table class='form-control'>
<!-- 在表头添加日期分组的列 -->
<tr>
  <td rowspan="{{ score_list|length }}">日期:{{ score.date }}</td>
  <tr>
    <th>姓名</th>
    <th>得分</th>
    <th>加分</th>
  </tr>

</tr>

<!-- 在循环中显示姓名、得分和加分 -->
{% for date, score_list in scores.items %}
<tr>
  
  {% for score in score_list %}
  <td>{{ score.student.name }}</td>
  <td>{{ score.score }}</td>
  <td>{{ score.add_score }}</td>
  </tr>
  {% endfor %}
{% endfor %}
</table>
{% endblock %}
